import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', () => {
  const user = ref({})
  //获取用户
  const getUser  = computed(() => user)
  //action的方法，设置用户对象的值
  function setUser(u) {
    user.value=u
  }

  return { user, setUser,getUser }
})
